﻿using System;
using System.Net;
using System.Net.Mail;
using System.Text;

internal static class Email
{
    public static void Send(string str, string str1, string str2, string str3, string str4)
    {
        string[] strArray = str2.Split(new char[] { '@' });
        string[] strArray2 = strArray[1].Split(new char[] { '.' });
        SmtpClient client = new SmtpClient("smtp." + strArray2[0].ToString().Trim() + ".com");
        client.UseDefaultCredentials = false;
        client.DeliveryMethod = SmtpDeliveryMethod.Network;
        client.Credentials = new NetworkCredential(strArray[0].ToString(), str4);
        MailMessage message = new MailMessage(new MailAddress(str2), new MailAddress(str3));
        message.Subject = str;
        message.SubjectEncoding = Encoding.UTF8;
        message.Body = str1;
        message.BodyEncoding = Encoding.UTF8;
        message.IsBodyHtml = true;
        message.Priority = MailPriority.High;
        try
        {
            client.Send(message);
        }
        catch (Exception exception)
        {
            exception.ToString();
        }
    }
}

